Salesforce UX API icon

Salesforce UX API

(0 reviews)

TMF-687 Interface to inform pick-up is done

This operation is used to inform Asset pick-up is done from Service Center ( B2BSoft will be informed of stock movement using TransactionId ) (SF --> ESB --> B2BSoft)

URL
https://[localhost]:[port]/sfdc-ux/v1/{businessId}/productStock/{id}
Param
nametypedescriptionrequired
businessIdstring2 letter ISO 3166 country code (TT, BB, JM, PA, PR etc.) identifying the business unit.
Expected one is "PR"
Y
idstringOriginal transaction ID for the call center payment collection
(Call centre payment collected transactionID from POS)
Y
namevaluedescriptionrequired
client_idstringThe client_id identifying the channel.Y
client_secretstringPassword associated with the client_id.Y
X-Correlation-IDstringIdentifier that correlates HTTP request between a client and server.
Any identification model (UUDI, checksum, etc.) can be used, as long as it is a unique value to differentiate a transaction.
Y
cURL Request
curl --location --request PATCH 'https://nonprod.esb.cloud.lla.com/sfdc-ux/sfdc-ux/v1/PR/productStock/1234' \
--header 'X-Correlation-ID: f058ebd63456723' \
--header 'client_id: 12345' \
--header 'client_secret: abcde' \
--header 'Content-Type: application/json' \
--data-raw '{
    "description": "pick-up is done, stock moved out of the store",
    "stockLevelCategory": "pickupTransaction",
    "channel": [
        {
            "id": "SFDC-B2C"
        }
    ],
    "stockedProduct": {
        "productCharacteristic": [
            {
                "name": "posDocumentId",
                "valueType": "string",
                "value": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
            },
            {
                "name": "products",
                "valueType": "array",
                "value": [
                    {
                        "sku": "652810501996",
                        "quantity": 2,
                        "serials": [
                            "45653476457871",
                            "45653476457867"
                        ],
                        "sapReservationId ": "3fa85f64-5717-4562-b3fc-2c96"
                    }
                ]
            }
        ],
        "relatedParty": [
            {
                "name": "<username>",
                "role": "user",
                "@referredType": "Customer"
            },
            {
                "id": "13",
                "role": "Dealer",
                "@referredType": "Organization"
            }
        ]
    }
}'
Definitions

Each of the request parameters is detailed.

FYI, Y - Mandatory & N - Optional

nametypedescriptionrequired
descriptionstringFree-text description of the ProductStockN
stockLevelCategorystringCategory of the ProductStockN
channelarrayThe channel to which the resource reference to.N
channel.idstringChannel nameN
stockedProductobjectAsset stock moment detailsY
stockedProduct.productCharacteristicarrayDescribes a given characteristic of an object or entity through a name/value pair.
Please refer below 'productCharacteristic' table for more details
Y
stockedProduct.productCharacteristic.namestringName of the characteristicY
stockedProduct.productCharacteristic.valueanyValue of the characteristicY
stockedProduct.productCharacteristic.valueTypestringData type of the value of the characteristicN
stockedProduct.relatedPartyarrayRelated Entity reference
Please refer below 'RelatedParty' table for more details
Y
stockedProduct.relatedParty.namestringName of the related entity.Y
stockedProduct.relatedParty.rolestringRole played by the related partyY
stockedProduct.relatedParty.@referredTypestringThe actual type of the target instanceN
productCharacteristic Values
Characteristic nametypedescriptionrequired
posDocumentIdstringDocumentID received from POS during the reservation of items (Reservation API)Y
productsarrayProducts ArrayY
products.skustringSKU of the productY
products.quantityintQuantity of the productsY
products.serialsarrayArray of serial numbers of the product. Mandatory in case of serialized productsY*
products.sapReservationIdstringReservation ID from SAP (itemise at the product level)Y
RelatedParty Values
RelatedParty nametypedescriptionrequired
userNamestringUsername from SF and will be mapped to userId internally.Y
dealerCodestringDealer CodeY

Possible response success

This section defines all the possible data structures received by the client and that must be considered satisfactory at the time of responding to the method.

[ 200 ]

OK - updateResource request processed successfully, response body contains an entity corresponding to the requested resource.

{
    "stockedProduct": {
        "productCharacteristic": [
            {
                "name": "transactionID",
                "valueType": "string",
                "value": "79231"
            }
        ]
    },
    "productStockLevel": { //this is not coming from backend, as TMF it's mandatory so passing as static value
        "amount": 1,
        "units": "none"
    }
}
Definitions

Each of the request parameters is detailed.

nametypedescriptionrequired
stockedProductobjectAsset stock moment detailsN
productCharacteristicarrayDescribes a given characteristic of an object or entity through a name/value pair.
Please refer below 'productCharacteristic' table for more details
N
productCharacteristic.namestringName of the characteristicN
productCharacteristic.valueanyValue of the characteristicN
productCharacteristic.valueTypestringData type of characteristicN
productStockLevelobjectProduct stock level info
Note - This details not coming from backend system, is mandatory as per TMF data model this object is mandatory. Due this mapping static values in property file.
N
productStockLevel.amountnumberNumeric value in a given unitN
productStockLevel.unitsstringUnitN

Possible response error

In this section all the possible data structures received by the client are defined and that must be considered as unsatisfactory when responding to the method.

[ 400 ]

Bad Request - the request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

{
  "errors" : [{
      "code" : 400,
      "message" : "The request is invalid or not properly formed.",
      "description" : "Please validate the request as it is invalid or not properly formed"
    }]
}
[ 401 ]

Unauthorized - The request has not been applied because it lacks valid authentication credentials for the target resource.

{
  "errors" : [{
      "code" : 401,
      "message" : "The user could not be authenticated for this request.",
      "description" : "The request has not been applied because it lacks valid authentication credentials for the target resource"
    }]
}
[ 403 ]

Forbidden - Indicates that the server understood the request but refuses to fulfill it. If authentication credentials were provided in the request, the server considers them insufficient to grant access. The client SHOULD NOT automatically repeat the request with the same credentials. The client MAY repeat the request with new or different credentials.

[ 404 ]

Not Found - server has not found a resource with that URI. This may be temporary and permanent condition. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.

{
  "errors" : [{
      "code" : 404,
      "message" : "Requested resource not found",
      "description" : "The requested operation failed because a resource associated with the request could not be found."
    }]
}
[ 405 ]

Method Not Allowed - HTTP method not allowed for this resource. The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.

{
    "errors": [{
            "code": 405,
             "message": "APIKIT:METHOD_NOT_ALLOWED",
             "description": "HTTP Method post not allowed for : /{businessId}/productStock/XXX"
        }]
}
[ 500 ]

Internal Server Error - server encountered an error processing request. This should not happen normally, but it is a generic error message, given when no more specific message is suitable.

{
  "errors" : [{
      "code" : 500,
      "message" : "The request failed due to an internal error.",
      "description": "The request failed due to an internal error."
    }]
}
[ 502]

Bad Gateway - gateway is available but backend service is not. The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.

[ 503 ]

Service Unavailable - temporary maintenance of service, try again later. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay will be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response. Note: The existence of the 503 status code does not imply that a server will use it when becoming overloaded. Servers may simply refuse the connection.

    Retry-After: 120

Reviews